<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>我的粉丝</title>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/page.css">
    <script src="../js/jquery-3.2.1.min.js"></script>
    <script src="../js/media.js"></script>
    <script src="../js/common.js"></script>
    <style>

    </style>
</head>

<body>
    <!--头部-->
    <!-- <div class="public-header flex">
  
        <span class="public-header-left-back"></span>
        <span class="public-header-center">我的粉丝</span>
        <span class="public-header-right"></span>
    </div> -->

    <!--正文-->
    <div class="my-fan bc-gray">
        <ul>
            <li class="flex" v-for="item in datas">
                <img :src="item.user_image" alt="">
                <div class="center">
                    <p class="t1">
                        <span>{{item.user_nike_Name}}</span>
                        <em></em>
                        <i>{{item.user_grade_describe}}</i>
                    </p>
                    <p class="t2">
                        微信/电话：{{item.user_weixin}}
                    </p>
                </div>
                <!-- <button>已屏蔽</button> -->
                <span @click="tt(this)" style="background:url('../img/未提醒@2x.png') no-repeat center;background-size: contain;" v-if="item.shield"></span>
                <span @click="tt(this)" style="background:url('../img/提醒@2x 3.png') no-repeat center;background-size: contain;" v-else></span>
            </li>
        </ul>

    </div>



    <script src='../js/vue.js'></script>
    <script src='../js/vue-resource.min.js'></script>
    <script>
        $(function () {
            new Vue({
                el: 'body',
                data: {
                    storeid: s_id,
                    pinbi: 'true'
                },
                ready: function () {
                    this.$http.get(base_url + 'ZITAOHUI/store/fans', {
                        params: {
                            storeid: s_id
                        }
                    }).then(function (data) {
                        console.log(data)
                        for (let i = 0; i < data.data.extend.data.length; i++) {
                            if (data.data.extend.data[i].shield == 0) {
                       
                                this.pinbi = false;
                            } else {
                                this.pinbi = true;
                            }
                        }

                        this.$set('datas', data.data.extend.data)
                    })
                },
                methods: {
             
                    tt: function (t) {
                        console.log(t)
                        $.ajax({
                            url: base_url + 'ZITAOHUI/store/shield',
                            data: {
                                storeid: s_id,
                                uid: t.item.user_Id
                            },
                            success: function (data) {
                                console.log(data)
                                if (t.item.shield == 0) {
                                    t.item.shield = 1
                                } else {
                                    t.item.shield = 0
                                }
                            }
                        })
                    }
                }
            })

        })
    </script>
</body>

</html>